package com.qiyu.tech.design.starter;

/**
 * 保护组件
 *
 * @Author linhao
 * @Date created in 6:26 下午 2021/1/13
 */
public abstract class AbstractProtectHandler {

    private Object target;

    public AbstractProtectHandler(Object target) {
        this.target = target;
    }

    /**
     * 执行核心方法
     *
     * @return
     */
    public abstract Object doTargetCoreMethod(Object object);

    /**
     * 方法执行失败之后重试
     *
     * @return
     */
    public abstract Object doHandleAfterMethodFail();
}
